home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / __Packages / mx / video / FLVPlayback.as < prev    next >
Text File  |  2009-11-16  |  52KB  |  1,667 lines

  1. class mx.video.FLVPlayback extends MovieClip
  2. {
  3.    static var version = "1.0.1.10";
  4.    static var shortVersion = "1.0.1";
  5.    static var DISCONNECTED = "disconnected";
  6.    static var STOPPED = "stopped";
  7.    static var PLAYING = "playing";
  8.    static var PAUSED = "paused";
  9.    static var BUFFERING = "buffering";
  10.    static var LOADING = "loading";
  11.    static var CONNECTION_ERROR = "connectionError";
  12.    static var REWINDING = "rewinding";
  13.    static var SEEKING = "seeking";
  14.    static var ALL = "all";
  15.    static var EVENT = "event";
  16.    static var NAVIGATION = "navigation";
  17.    static var FLV = "flv";
  18.    static var ACTIONSCRIPT = "actionscript";
  19.    static var VP_DEPTH_OFFSET = 100;
  20.    static var SEEK_TO_PREV_OFFSET_DEFAULT = 1;
  21.    function FLVPlayback()
  22.    {
  23.       super();
  24.       mx.events.EventDispatcher.initialize(this);
  25.       if(this._autoPlay == undefined)
  26.       {
  27.          this._autoPlay = true;
  28.       }
  29.       if(this._autoRewind == undefined)
  30.       {
  31.          this._autoRewind = true;
  32.       }
  33.       if(this._autoSize == undefined)
  34.       {
  35.          this._autoSize = false;
  36.       }
  37.       if(this._bufferTime == undefined)
  38.       {
  39.          this._bufferTime = 0.1;
  40.       }
  41.       if(this._contentPath == undefined)
  42.       {
  43.          this._contentPath = "";
  44.       }
  45.       if(this._cuePoints == undefined)
  46.       {
  47.          this._cuePoints = null;
  48.       }
  49.       if(this._idleTimeout == undefined)
  50.       {
  51.          this._idleTimeout = mx.video.VideoPlayer.DEFAULT_IDLE_TIMEOUT_INTERVAL;
  52.       }
  53.       if(this._isLive == undefined)
  54.       {
  55.          this._isLive = false;
  56.       }
  57.       if(this._aspectRatio == undefined)
  58.       {
  59.          this._aspectRatio = true;
  60.       }
  61.       if(this._seekToPrevOffset == undefined)
  62.       {
  63.          this._seekToPrevOffset = mx.video.FLVPlayback.SEEK_TO_PREV_OFFSET_DEFAULT;
  64.       }
  65.       if(this._playheadUpdateInterval == undefined)
  66.       {
  67.          this._playheadUpdateInterval = mx.video.VideoPlayer.DEFAULT_UPDATE_PROGRESS_INTERVAL;
  68.       }
  69.       if(this._progressInterval == undefined)
  70.       {
  71.          this._progressInterval = mx.video.VideoPlayer.DEFAULT_UPDATE_TIME_INTERVAL;
  72.       }
  73.       if(this._totalTime == undefined)
  74.       {
  75.          this._totalTime = 0;
  76.       }
  77.       if(this._transform == undefined)
  78.       {
  79.          this._transform = null;
  80.       }
  81.       if(this._volume == undefined)
  82.       {
  83.          this._volume = 100;
  84.       }
  85.       if(this._skinAutoHide == undefined)
  86.       {
  87.          this._skinAutoHide = false;
  88.       }
  89.       if(this._bufferingBarHides == undefined)
  90.       {
  91.          this._bufferingBarHides = false;
  92.       }
  93.       this._origHeight = this._prevHeight = this.__height = this._height;
  94.       this._origWidth = this._prevWidth = this.__width = this._width;
  95.       this._scaleX = 100;
  96.       this._scaleY = 100;
  97.       this._xscale = 100;
  98.       this._yscale = 100;
  99.       this._preSeekTime = -1;
  100.       this._firstStreamReady = false;
  101.       this._firstStreamShown = false;
  102.       this.createUIManager();
  103.       this._activeVP = 0;
  104.       this._visibleVP = 0;
  105.       this._topVP = 0;
  106.       this._vp = new Array();
  107.       this._vpState = new Array();
  108.       this._cpMgr = new Array();
  109.       this.createVideoPlayer(0);
  110.       this._vp[0].visible = false;
  111.       this._vp[0].volume = 0;
  112.       this.boundingBox_mc._visible = false;
  113.       this.boundingBox_mc.unloadMovie();
  114.       delete this.boundingBox_mc;
  115.       if(_global.isLivePreview)
  116.       {
  117.          this.createLivePreviewMovieClip();
  118.          this.setSize(this.__width,this.__height);
  119.       }
  120.       this._cpMgr[0].processCuePointsProperty(this._cuePoints);
  121.       delete this._cuePoints;
  122.       this._cuePoints = null;
  123.    }
  124.    function setSize(w, h)
  125.    {
  126.       if(_global.isLivePreview)
  127.       {
  128.          if(this.preview_mc == undefined)
  129.          {
  130.             this.createLivePreviewMovieClip();
  131.          }
  132.          this.preview_mc.box_mc._width = w;
  133.          this.preview_mc.box_mc._height = h;
  134.          if(this.preview_mc.box_mc._width < this.preview_mc.icon_mc._width || this.preview_mc.box_mc._height < this.preview_mc.icon_mc._height)
  135.          {
  136.             this.preview_mc.icon_mc._visible = false;
  137.          }
  138.          else
  139.          {
  140.             this.preview_mc.icon_mc._visible = true;
  141.             this.preview_mc.icon_mc._x = (this.preview_mc.box_mc._width - this.preview_mc.icon_mc._width) / 2;
  142.             this.preview_mc.icon_mc._y = (this.preview_mc.box_mc._height - this.preview_mc.icon_mc._height) / 2;
  143.          }
  144.       }
  145.       if(w == this.__get__width() && h == this.__get__height())
  146.       {
  147.          return undefined;
  148.       }
  149.       this._prevWidth = this.__width = w;
  150.       this._prevHeight = this.__height = h;
  151.       var _loc3_ = 0;
  152.       while(_loc3_ < this._vp.length)
  153.       {
  154.          if(this._vp[_loc3_] != undefined)
  155.          {
  156.             this._vp[_loc3_].setSize(w,h);
  157.          }
  158.          _loc3_ = _loc3_ + 1;
  159.       }
  160.       this.dispatchEvent({type:"resize",x:this.__get__x(),y:this.__get__y(),width:w,height:h});
  161.    }
  162.    function setScale(xs, ys)
  163.    {
  164.       if(xs == this.__get__scaleX() && ys == this.__get__scaleY())
  165.       {
  166.          return undefined;
  167.       }
  168.       this._scaleX = xs;
  169.       this._scaleY = ys;
  170.       var _loc2_ = 0;
  171.       while(_loc2_ < this._vp.length)
  172.       {
  173.          if(this._vp[_loc2_] != undefined)
  174.          {
  175.             this._vp[_loc2_].setSize(this._origWidth * xs / 100,this._origHeight * ys / 100);
  176.          }
  177.          _loc2_ = _loc2_ + 1;
  178.       }
  179.       this.dispatchEvent({type:"resize",x:this.__get__x(),y:this.__get__y(),width:this.__get__width(),height:this.__get__height()});
  180.    }
  181.    function handleEvent(e)
  182.    {
  183.       var _loc3_ = e.state;
  184.       if(e.state != undefined && e.target._name == this._visibleVP && this.__get__scrubbing())
  185.       {
  186.          _loc3_ = mx.video.FLVPlayback.SEEKING;
  187.       }
  188.       if(e.type == "metadataReceived")
  189.       {
  190.          this._cpMgr[e.target._name].processFLVCuePoints(e.info.cuePoints);
  191.          this.dispatchEvent({type:e.type,info:e.info,vp:e.target._name});
  192.       }
  193.       else if(e.type == "cuePoint")
  194.       {
  195.          if(this._cpMgr[e.target._name].isFLVCuePointEnabled(e.info))
  196.          {
  197.             this.dispatchEvent({type:e.type,info:e.info,vp:e.target._name});
  198.          }
  199.       }
  200.       else if(e.type == "rewind")
  201.       {
  202.          this.dispatchEvent({type:e.type,auto:true,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  203.          this._cpMgr[e.target._name].resetASCuePointIndex(e.playheadTime);
  204.       }
  205.       else if(e.type == "resize")
  206.       {
  207.          this.dispatchEvent({type:e.type,x:this.__get__x(),y:this.__get__y(),width:this.__get__width(),height:this.__get__height(),auto:true,vp:e.target._name});
  208.          this._prevWidth = this.__width;
  209.          this._prevHeight = this.__height;
  210.       }
  211.       else if(e.type == "playheadUpdate")
  212.       {
  213.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  214.          if(this._preSeekTime >= 0 && e.target.state != mx.video.FLVPlayback.SEEKING)
  215.          {
  216.             var _loc5_ = this._preSeekTime;
  217.             this._preSeekTime = -1;
  218.             this._cpMgr[e.target._name].resetASCuePointIndex(e.playheadTime);
  219.             this.dispatchEvent({type:"seek",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  220.             if(_loc5_ < e.playheadTime)
  221.             {
  222.                this.dispatchEvent({type:"fastForward",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  223.             }
  224.             else if(_loc5_ > e.playheadTime)
  225.             {
  226.                this.dispatchEvent({type:"rewind",auto:false,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  227.             }
  228.          }
  229.          this._cpMgr[e.target._name].dispatchASCuePoints();
  230.       }
  231.       else if(e.type == "stateChange")
  232.       {
  233.          var _loc4_ = e.target._name;
  234.          if(_loc4_ == this._visibleVP && this.__get__scrubbing())
  235.          {
  236.             return undefined;
  237.          }
  238.          if(e.state == mx.video.VideoPlayer.RESIZING)
  239.          {
  240.             return undefined;
  241.          }
  242.          if(this._vpState[_loc4_].prevState == mx.video.FLVPlayback.LOADING && this._vpState[_loc4_].autoPlay && e.state == mx.video.FLVPlayback.STOPPED)
  243.          {
  244.             return undefined;
  245.          }
  246.          this._vpState[_loc4_].prevState = e.state;
  247.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  248.          if(this._vp[e.target._name].state != _loc3_)
  249.          {
  250.             return undefined;
  251.          }
  252.          switch(_loc3_)
  253.          {
  254.             case mx.video.FLVPlayback.BUFFERING:
  255.                this.dispatchEvent({type:"buffering",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  256.                break;
  257.             case mx.video.FLVPlayback.PAUSED:
  258.                this.dispatchEvent({type:"paused",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  259.                break;
  260.             case mx.video.FLVPlayback.PLAYING:
  261.                this.dispatchEvent({type:"playing",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  262.                break;
  263.             case mx.video.FLVPlayback.STOPPED:
  264.                this.dispatchEvent({type:"stopped",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  265.          }
  266.       }
  267.       else if(e.type == "progress")
  268.       {
  269.          this.dispatchEvent({type:e.type,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,vp:e.target._name});
  270.       }
  271.       else if(e.type == "ready")
  272.       {
  273.          _loc4_ = e.target._name;
  274.          if(!this._firstStreamReady)
  275.          {
  276.             if(_loc4_ == this._visibleVP)
  277.             {
  278.                this._firstStreamReady = true;
  279.                if(this._uiMgr.__get__skinReady() && !this._firstStreamShown)
  280.                {
  281.                   this._uiMgr.__set__visible(true);
  282.                   this.showFirstStream();
  283.                }
  284.             }
  285.          }
  286.          else if(this._firstStreamShown && _loc3_ == mx.video.FLVPlayback.STOPPED && this._vpState[_loc4_].autoPlay)
  287.          {
  288.             this._vp[_loc4_].play();
  289.          }
  290.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  291.       }
  292.       else if(e.type == "close" || e.type == "complete")
  293.       {
  294.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  295.       }
  296.    }
  297.    function load(contentPath, totalTime, isLive)
  298.    {
  299.       if(this._vp[this._activeVP] == undefined)
  300.       {
  301.          return undefined;
  302.       }
  303.       if(contentPath == undefined || contentPath == null || contentPath == "")
  304.       {
  305.          return undefined;
  306.       }
  307.       this.__set__autoPlay(false);
  308.       if(totalTime != undefined)
  309.       {
  310.          this.__set__totalTime(totalTime);
  311.       }
  312.       if(isLive != undefined)
  313.       {
  314.          this.__set__isLive(isLive);
  315.       }
  316.       this.__set__contentPath(contentPath);
  317.    }
  318.    function play(contentPath, totalTime, isLive)
  319.    {
  320.       if(this._vp[this._activeVP] == undefined)
  321.       {
  322.          return undefined;
  323.       }
  324.       if(contentPath == undefined)
  325.       {
  326.          this._vp[this._activeVP].play();
  327.       }
  328.       else
  329.       {
  330.          this.__set__autoPlay(true);
  331.          if(totalTime != undefined)
  332.          {
  333.             this.__set__totalTime(totalTime);
  334.          }
  335.          if(isLive != undefined)
  336.          {
  337.             this.__set__isLive(isLive);
  338.          }
  339.          this.__set__contentPath(contentPath);
  340.       }
  341.    }
  342.    function pause()
  343.    {
  344.       if(this._vp[this._activeVP] == undefined)
  345.       {
  346.          return undefined;
  347.       }
  348.       this._vp[this._activeVP].pause();
  349.    }
  350.    function stop()
  351.    {
  352.       if(this._vp[this._activeVP] == undefined)
  353.       {
  354.          return undefined;
  355.       }
  356.       this._vp[this._activeVP].stop();
  357.    }
  358.    function seek(time)
  359.    {
  360.       if(this._vp[this._activeVP] == undefined)
  361.       {
  362.          return undefined;
  363.       }
  364.       this._preSeekTime = this.playheadTime;
  365.       this._vp[this._activeVP].seek(time);
  366.    }
  367.    function seekSeconds(time)
  368.    {
  369.       this.seek(time);
  370.    }
  371.    function seekPercent(percent)
  372.    {
  373.       if(this._vp[this._activeVP] == undefined)
  374.       {
  375.          return undefined;
  376.       }
  377.       if(percent < 0 || percent > 100 || this._vp[this._activeVP].totalTime == undefined || this._vp[this._activeVP].totalTime == null || this._vp[this._activeVP].totalTime <= 0)
  378.       {
  379.          throw new mx.video.VideoError(mx.video.VideoError.INVALID_SEEK);
  380.       }
  381.       else
  382.       {
  383.          this.seek(this._vp[this._activeVP].totalTime * percent / 100);
  384.       }
  385.    }
  386.    function get playheadPercentage()
  387.    {
  388.       if(this._vp[this._activeVP].totalTime == undefined || this._vp[this._activeVP].totalTime == null || this._vp[this._activeVP].totalTime <= 0)
  389.       {
  390.          return undefined;
  391.       }
  392.       return this._vp[this._activeVP].playheadTime / this._vp[this._activeVP].totalTime * 100;
  393.    }
  394.    function set playheadPercentage(percent)
  395.    {
  396.       this.seekPercent(percent);
  397.    }
  398.    function seekToNavCuePoint(timeNameOrCuePoint)
  399.    {
  400.       var _loc3_ = undefined;
  401.       switch(typeof timeNameOrCuePoint)
  402.       {
  403.          case "string":
  404.             _loc3_ = {name:timeNameOrCuePoint};
  405.             break;
  406.          case "number":
  407.             _loc3_ = {time:timeNameOrCuePoint};
  408.             break;
  409.          case "object":
  410.             _loc3_ = timeNameOrCuePoint;
  411.       }
  412.       if(_loc3_.name == null || _loc3_.name == undefined || typeof _loc3_.name != "string")
  413.       {
  414.          this.seekToNextNavCuePoint(_loc3_.time);
  415.          return undefined;
  416.       }
  417.       if(isNaN(_loc3_.time))
  418.       {
  419.          _loc3_.time = 0;
  420.       }
  421.       var _loc2_ = this.findNearestCuePoint(timeNameOrCuePoint,mx.video.FLVPlayback.NAVIGATION);
  422.       while(_loc2_ != null && (_loc2_.time < _loc3_.time || !this.isFLVCuePointEnabled(_loc2_)))
  423.       {
  424.          _loc2_ = this.findNextCuePointWithName(_loc2_);
  425.       }
  426.       if(_loc2_ == null)
  427.       {
  428.          throw new mx.video.VideoError(mx.video.VideoError.INVALID_SEEK);
  429.       }
  430.       else
  431.       {
  432.          this.seek(_loc2_.time);
  433.       }
  434.    }
  435.    function seekToNextNavCuePoint(time)
  436.    {
  437.       if(this._vp[this._activeVP] == undefined)
  438.       {
  439.          return undefined;
  440.       }
  441.       if(isNaN(time) || time < 0)
  442.       {
  443.          time = this._vp[this._activeVP].playheadTime + 0.001;
  444.       }
  445.       var _loc3_ = undefined;
  446.       _loc3_ = this.findNearestCuePoint(time,mx.video.FLVPlayback.NAVIGATION);
  447.       if(_loc3_ == null)
  448.       {
  449.          this.seek(this._vp[this._activeVP].totalTime);
  450.          return undefined;
  451.       }
  452.       var _loc2_ = _loc3_.index;
  453.       if(_loc3_.time < time)
  454.       {
  455.          _loc2_ = _loc2_ + 1;
  456.       }
  457.       while(_loc2_ < _loc3_.array.length && !this.isFLVCuePointEnabled(_loc3_.array[_loc2_]))
  458.       {
  459.          _loc2_ = _loc2_ + 1;
  460.       }
  461.       if(_loc2_ >= _loc3_.array.length)
  462.       {
  463.          var _loc5_ = this._vp[this._activeVP].totalTime;
  464.          if(_loc3_.array[_loc3_.array.length - 1].time > _loc5_)
  465.          {
  466.             _loc5_ = _loc3_.array[_loc3_.array.length - 1];
  467.          }
  468.          this.seek(_loc5_);
  469.       }
  470.       else
  471.       {
  472.          this.seek(_loc3_.array[_loc2_].time);
  473.       }
  474.    }
  475.    function seekToPrevNavCuePoint(time)
  476.    {
  477.       if(this._vp[this._activeVP] == undefined)
  478.       {
  479.          return undefined;
  480.       }
  481.       if(isNaN(time) || time < 0)
  482.       {
  483.          time = this._vp[this._activeVP].playheadTime;
  484.       }
  485.       var _loc3_ = this.findNearestCuePoint(time,mx.video.FLVPlayback.NAVIGATION);
  486.       if(_loc3_ == null)
  487.       {
  488.          this.seek(0);
  489.          return undefined;
  490.       }
  491.       var _loc2_ = _loc3_.index;
  492.       while(_loc2_ >= 0 && (!this.isFLVCuePointEnabled(_loc3_.array[_loc2_]) || _loc3_.array[_loc2_].time >= time - this._seekToPrevOffset))
  493.       {
  494.          _loc2_ = _loc2_ - 1;
  495.       }
  496.       if(_loc2_ < 0)
  497.       {
  498.          this.seek(0);
  499.       }
  500.       else
  501.       {
  502.          this.seek(_loc3_.array[_loc2_].time);
  503.       }
  504.    }
  505.    function addASCuePoint(timeOrCuePoint, name, parameters)
  506.    {
  507.       return this._cpMgr[this._activeVP].addASCuePoint(timeOrCuePoint,name,parameters);
  508.    }
  509.    function removeASCuePoint(timeNameOrCuePoint)
  510.    {
  511.       return this._cpMgr[this._activeVP].removeASCuePoint(timeNameOrCuePoint);
  512.    }
  513.    function findCuePoint(timeNameOrCuePoint, type)
  514.    {
  515.       switch(type)
  516.       {
  517.          case "event":
  518.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].eventCuePoints,false,timeNameOrCuePoint);
  519.          case "navigation":
  520.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].navCuePoints,false,timeNameOrCuePoint);
  521.          case "flv":
  522.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].flvCuePoints,false,timeNameOrCuePoint);
  523.          case "actionscript":
  524.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].asCuePoints,false,timeNameOrCuePoint);
  525.          case "all":
  526.          default:
  527.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].allCuePoints,false,timeNameOrCuePoint);
  528.       }
  529.    }
  530.    function findNearestCuePoint(timeNameOrCuePoint, type)
  531.    {
  532.       switch(type)
  533.       {
  534.          case "event":
  535.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].eventCuePoints,true,timeNameOrCuePoint);
  536.          case "navigation":
  537.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].navCuePoints,true,timeNameOrCuePoint);
  538.          case "flv":
  539.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].flvCuePoints,true,timeNameOrCuePoint);
  540.          case "actionscript":
  541.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].asCuePoints,true,timeNameOrCuePoint);
  542.          case "all":
  543.          default:
  544.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].allCuePoints,true,timeNameOrCuePoint);
  545.       }
  546.    }
  547.    function findNextCuePointWithName(cuePoint)
  548.    {
  549.       return this._cpMgr[this._activeVP].getNextCuePointWithName(cuePoint);
  550.    }
  551.    function setFLVCuePointEnabled(enabled, timeNameOrCuePoint)
  552.    {
  553.       return this._cpMgr[this._activeVP].setFLVCuePointEnabled(enabled,timeNameOrCuePoint);
  554.    }
  555.    function isFLVCuePointEnabled(timeNameOrCuePoint)
  556.    {
  557.       return this._cpMgr[this._activeVP].isFLVCuePointEnabled(timeNameOrCuePoint);
  558.    }
  559.    function getNextHighestDepth()
  560.    {
  561.       var _loc2_ = super.getNextHighestDepth();
  562.       return _loc2_ >= 1000 ? _loc2_ : 1000;
  563.    }
  564.    function bringVideoPlayerToFront(index)
  565.    {
  566.       if(index == this._topVP || this._vp[index] == undefined)
  567.       {
  568.          return undefined;
  569.       }
  570.       this._vp[this._topVP].swapDepths(this._vp[index].getDepth());
  571.       this._topVP = index;
  572.    }
  573.    function getVideoPlayer(index)
  574.    {
  575.       return this._vp[index];
  576.    }
  577.    function closeVideoPlayer(index)
  578.    {
  579.       if(this._vp[index] == undefined)
  580.       {
  581.          return undefined;
  582.       }
  583.       if(index == 0)
  584.       {
  585.          throw new mx.video.VideoError(mx.video.VideoError.DELETE_DEFAULT_PLAYER);
  586.       }
  587.       else
  588.       {
  589.          if(this._visibleVP == index)
  590.          {
  591.             this.__set__visibleVideoPlayerIndex(0);
  592.          }
  593.          if(this._activeVP == index)
  594.          {
  595.             this.__set__activeVideoPlayerIndex(0);
  596.          }
  597.          this._vp[index].close();
  598.          this._vp[index].unloadMovie();
  599.          delete this._vp[index];
  600.          this._vp[index] = undefined;
  601.       }
  602.    }
  603.    function get activeVideoPlayerIndex()
  604.    {
  605.       return this._activeVP;
  606.    }
  607.    function set activeVideoPlayerIndex(i)
  608.    {
  609.       if(this._activeVP == i)
  610.       {
  611.          return undefined;
  612.       }
  613.       if(this._vp[this._activeVP].onEnterFrame != undefined)
  614.       {
  615.          this.doContentPathConnect();
  616.       }
  617.       this._activeVP = i;
  618.       if(this._vp[this._activeVP] == undefined)
  619.       {
  620.          this.createVideoPlayer(this._activeVP);
  621.          this._vp[this._activeVP].visible = false;
  622.          this._vp[this._activeVP].volume = 0;
  623.       }
  624.    }
  625.    function get autoPlay()
  626.    {
  627.       if(this._vpState[this._activeVP] == undefined)
  628.       {
  629.          return this._autoPlay;
  630.       }
  631.       return this._vpState[this._activeVP].autoPlay;
  632.    }
  633.    function set autoPlay(flag)
  634.    {
  635.       if(this._activeVP == 0 || this._activeVP == undefined)
  636.       {
  637.          this._autoPlay = flag;
  638.       }
  639.       this._vpState[this._activeVP].autoPlay = flag;
  640.    }
  641.    function get autoRewind()
  642.    {
  643.       if(this._vp[this._activeVP] == undefined)
  644.       {
  645.          return this._autoRewind;
  646.       }
  647.       return this._vp[this._activeVP].autoRewind;
  648.    }
  649.    function set autoRewind(flag)
  650.    {
  651.       if(this._activeVP == 0 || this._activeVP == undefined)
  652.       {
  653.          this._autoRewind = flag;
  654.       }
  655.       this._vp[this._activeVP].autoRewind = flag;
  656.    }
  657.    function get autoSize()
  658.    {
  659.       if(this._vp[this._activeVP] == undefined)
  660.       {
  661.          return this._autoSize;
  662.       }
  663.       return this._vp[this._activeVP].autoSize;
  664.    }
  665.    function set autoSize(flag)
  666.    {
  667.       if(this._activeVP == 0 || this._activeVP == undefined)
  668.       {
  669.          this._autoSize = flag;
  670.       }
  671.       this._vp[this._activeVP].autoSize = flag;
  672.    }
  673.    function get bitrate()
  674.    {
  675.       return this.__get__ncMgr().getBitrate();
  676.    }
  677.    function set bitrate(b)
  678.    {
  679.       this.__get__ncMgr().setBitrate(b);
  680.    }
  681.    function get buffering()
  682.    {
  683.       if(this._vp[this._activeVP] == undefined)
  684.       {
  685.          return false;
  686.       }
  687.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.BUFFERING;
  688.    }
  689.    function get bufferingBar()
  690.    {
  691.       if(this._uiMgr != null && this._uiMgr != undefined)
  692.       {
  693.          this._bufferingBar = this._uiMgr.getControl(mx.video.UIManager.BUFFERING_BAR);
  694.       }
  695.       return this._bufferingBar;
  696.    }
  697.    function set bufferingBar(s)
  698.    {
  699.       this._bufferingBar = s;
  700.       if(this._uiMgr != null && this._uiMgr != undefined)
  701.       {
  702.          this._uiMgr.setControl(mx.video.UIManager.BUFFERING_BAR,s);
  703.       }
  704.    }
  705.    function get bufferingBarHidesAndDisablesOthers()
  706.    {
  707.       if(this._uiMgr != null && this._uiMgr != undefined)
  708.       {
  709.          this._bufferingBarHides = this._uiMgr.bufferingBarHidesAndDisablesOthers;
  710.       }
  711.       return this._bufferingBarHides;
  712.    }
  713.    function set bufferingBarHidesAndDisablesOthers(b)
  714.    {
  715.       this._bufferingBarHides = b;
  716.       if(this._uiMgr != null && this._uiMgr != undefined)
  717.       {
  718.          this._uiMgr.__set__bufferingBarHidesAndDisablesOthers(b);
  719.       }
  720.    }
  721.    function get backButton()
  722.    {
  723.       if(this._uiMgr != null && this._uiMgr != undefined)
  724.       {
  725.          this._backButton = this._uiMgr.getControl(mx.video.UIManager.BACK_BUTTON);
  726.       }
  727.       return this._backButton;
  728.    }
  729.    function set backButton(s)
  730.    {
  731.       this._backButton = s;
  732.       if(this._uiMgr != null && this._uiMgr != undefined)
  733.       {
  734.          this._uiMgr.setControl(mx.video.UIManager.BACK_BUTTON,s);
  735.       }
  736.    }
  737.    function get bufferTime()
  738.    {
  739.       if(this._vp[this._activeVP] == undefined)
  740.       {
  741.          return this._bufferTime;
  742.       }
  743.       return this._vp[this._activeVP].bufferTime;
  744.    }
  745.    function set bufferTime(aTime)
  746.    {
  747.       if(this._activeVP == 0 || this._activeVP == undefined)
  748.       {
  749.          this._bufferTime = aTime;
  750.       }
  751.       this._vp[this._activeVP].bufferTime = aTime;
  752.    }
  753.    function get bytesLoaded()
  754.    {
  755.       return this._vp[this._activeVP].bytesLoaded;
  756.    }
  757.    function get bytesTotal()
  758.    {
  759.       return this._vp[this._activeVP].bytesTotal;
  760.    }
  761.    function get contentPath()
  762.    {
  763.       if(this._vp[this._activeVP] == undefined || this._vp[this._activeVP].onEnterFrame != undefined)
  764.       {
  765.          return this._contentPath;
  766.       }
  767.       return this._vp[this._activeVP].url;
  768.    }
  769.    function set contentPath(url)
  770.    {
  771.       if(_global.isLivePreview)
  772.       {
  773.          return undefined;
  774.       }
  775.       if(this._vp[this._activeVP] == undefined)
  776.       {
  777.          if(url == this._contentPath)
  778.          {
  779.             return undefined;
  780.          }
  781.          this._contentPath = url;
  782.       }
  783.       else
  784.       {
  785.          if(this._vp[this._activeVP].url == url)
  786.          {
  787.             return undefined;
  788.          }
  789.          this._vpState[this._activeVP].minProgressPercent = undefined;
  790.          if(this._vp[this._activeVP].onEnterFrame != undefined)
  791.          {
  792.             delete this._vp[this._activeVP].onEnterFrame;
  793.             this._vp[this._activeVP].onEnterFrame = undefined;
  794.          }
  795.          this._cpMgr[this._activeVP].reset();
  796.          if(this._vpState[this._activeVP].autoPlay && this._firstStreamShown)
  797.          {
  798.             this._vp[this._activeVP].play(url,this._vpState[this._activeVP].isLive,this._vpState[this._activeVP].totalTime);
  799.          }
  800.          else
  801.          {
  802.             this._vp[this._activeVP].load(url,this._vpState[this._activeVP].isLive,this._vpState[this._activeVP].totalTime);
  803.          }
  804.          this._vpState[this._activeVP].isLiveSet = false;
  805.          this._vpState[this._activeVP].totalTimeSet = false;
  806.       }
  807.    }
  808.    function set cuePoints(cp)
  809.    {
  810.       if(this._cuePoints != undefined)
  811.       {
  812.          return undefined;
  813.       }
  814.       this._cuePoints = cp;
  815.    }
  816.    function get forwardButton()
  817.    {
  818.       if(this._uiMgr != null && this._uiMgr != undefined)
  819.       {
  820.          this._forwardButton = this._uiMgr.getControl(mx.video.UIManager.FORWARD_BUTTON);
  821.       }
  822.       return this._forwardButton;
  823.    }
  824.    function set forwardButton(s)
  825.    {
  826.       this._forwardButton = s;
  827.       if(this._uiMgr != null && this._uiMgr != undefined)
  828.       {
  829.          this._uiMgr.setControl(mx.video.UIManager.FORWARD_BUTTON,s);
  830.       }
  831.    }
  832.    function get height()
  833.    {
  834.       if(_global.isLivePreview)
  835.       {
  836.          return this.__height;
  837.       }
  838.       if(this._vp[this._visibleVP] != undefined)
  839.       {
  840.          this.__height = this._vp[this._visibleVP].height;
  841.       }
  842.       return this.__height;
  843.    }
  844.    function set height(h)
  845.    {
  846.       this.setSize(this.__get__width(),h);
  847.    }
  848.    function get idleTimeout()
  849.    {
  850.       if(this._vp[this._activeVP] == undefined)
  851.       {
  852.          return this._idleTimeout;
  853.       }
  854.       return this._vp[this._activeVP].idleTimeout;
  855.    }
  856.    function set idleTimeout(aTime)
  857.    {
  858.       if(this._activeVP == 0 || this._activeVP == undefined)
  859.       {
  860.          this._idleTimeout = aTime;
  861.       }
  862.       this._vp[this._activeVP].idleTimeout = aTime;
  863.    }
  864.    function get isRTMP()
  865.    {
  866.       if(_global.isLivePreview)
  867.       {
  868.          return true;
  869.       }
  870.       if(this._vp[this._activeVP] == undefined)
  871.       {
  872.          return undefined;
  873.       }
  874.       return this._vp[this._activeVP].isRTMP;
  875.    }
  876.    function get isLive()
  877.    {
  878.       if(this._vp[this._activeVP] == undefined)
  879.       {
  880.          return this._isLive;
  881.       }
  882.       if(this._vpState[this._activeVP].isLiveSet)
  883.       {
  884.          return this._vpState[this._activeVP].isLive;
  885.       }
  886.       return this._vp[this._activeVP].isLive;
  887.    }
  888.    function set isLive(flag)
  889.    {
  890.       if(this._activeVP == 0 || this._activeVP == undefined)
  891.       {
  892.          this._isLive = flag;
  893.       }
  894.       this._vpState[this._activeVP].isLive = flag;
  895.       this._vpState[this._activeVP].isLiveSet = true;
  896.    }
  897.    function get maintainAspectRatio()
  898.    {
  899.       if(this._vp[this._activeVP] == undefined)
  900.       {
  901.          return this._aspectRatio;
  902.       }
  903.       return this._vp[this._activeVP].maintainAspectRatio;
  904.    }
  905.    function set maintainAspectRatio(flag)
  906.    {
  907.       if(this._activeVP == 0 || this._activeVP == undefined)
  908.       {
  909.          this._aspectRatio = flag;
  910.       }
  911.       this._vp[this._activeVP].maintainAspectRatio = flag;
  912.    }
  913.    function get metadata()
  914.    {
  915.       if(this._vp[this._activeVP] == undefined)
  916.       {
  917.          return null;
  918.       }
  919.       return this._vp[this._activeVP].metadata;
  920.    }
  921.    function get metadataLoaded()
  922.    {
  923.       if(this._vp[this._activeVP] == undefined)
  924.       {
  925.          return false;
  926.       }
  927.       return this._cpMgr[this._activeVP].metadataLoaded;
  928.    }
  929.    function get muteButton()
  930.    {
  931.       if(this._uiMgr != null && this._uiMgr != undefined)
  932.       {
  933.          this._muteButton = this._uiMgr.getControl(mx.video.UIManager.MUTE_BUTTON);
  934.       }
  935.       return this._muteButton;
  936.    }
  937.    function set muteButton(s)
  938.    {
  939.       this._muteButton = s;
  940.       if(this._uiMgr != null && this._uiMgr != undefined)
  941.       {
  942.          this._uiMgr.setControl(mx.video.UIManager.MUTE_BUTTON,s);
  943.       }
  944.    }
  945.    function get ncMgr()
  946.    {
  947.       if(this._vp[this._activeVP] == undefined)
  948.       {
  949.          return null;
  950.       }
  951.       return this._vp[this._activeVP].ncMgr;
  952.    }
  953.    function get pauseButton()
  954.    {
  955.       if(this._uiMgr != null && this._uiMgr != undefined)
  956.       {
  957.          this._pauseButton = this._uiMgr.getControl(mx.video.UIManager.PAUSE_BUTTON);
  958.       }
  959.       return this._pauseButton;
  960.    }
  961.    function set pauseButton(s)
  962.    {
  963.       this._pauseButton = s;
  964.       if(this._uiMgr != null && this._uiMgr != undefined)
  965.       {
  966.          this._uiMgr.setControl(mx.video.UIManager.PAUSE_BUTTON,s);
  967.       }
  968.    }
  969.    function get paused()
  970.    {
  971.       if(this._vp[this._activeVP] == undefined)
  972.       {
  973.          return false;
  974.       }
  975.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.PAUSED;
  976.    }
  977.    function get playButton()
  978.    {
  979.       if(this._uiMgr != null && this._uiMgr != undefined)
  980.       {
  981.          this._playButton = this._uiMgr.getControl(mx.video.UIManager.PLAY_BUTTON);
  982.       }
  983.       return this._playButton;
  984.    }
  985.    function set playButton(s)
  986.    {
  987.       this._playButton = s;
  988.       if(this._uiMgr != null && this._uiMgr != undefined)
  989.       {
  990.          this._uiMgr.setControl(mx.video.UIManager.PLAY_BUTTON,s);
  991.       }
  992.    }
  993.    function get playheadTime()
  994.    {
  995.       if(this._vp[this._activeVP] == undefined)
  996.       {
  997.          return 0;
  998.       }
  999.       return this._vp[this._activeVP].playheadTime;
  1000.    }
  1001.    function set playheadTime(position)
  1002.    {
  1003.       this.seek(position);
  1004.    }
  1005.    function get playheadUpdateInterval()
  1006.    {
  1007.       if(this._vp[this._activeVP] == undefined)
  1008.       {
  1009.          return this._playheadUpdateInterval;
  1010.       }
  1011.       return this._vp[this._activeVP].playheadUpdateInterval;
  1012.    }
  1013.    function set playheadUpdateInterval(aTime)
  1014.    {
  1015.       if(this._activeVP == 0 || this._activeVP == undefined)
  1016.       {
  1017.          this._playheadUpdateInterval = aTime;
  1018.       }
  1019.       this._cpMgr[this._activeVP].playheadUpdateInterval = aTime;
  1020.       this._vp[this._activeVP].playheadUpdateInterval = aTime;
  1021.    }
  1022.    function get playing()
  1023.    {
  1024.       if(this._vp[this._activeVP] == undefined)
  1025.       {
  1026.          return false;
  1027.       }
  1028.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.PLAYING;
  1029.    }
  1030.    function get playPauseButton()
  1031.    {
  1032.       if(this._uiMgr != null && this._uiMgr != undefined)
  1033.       {
  1034.          this._playPauseButton = this._uiMgr.getControl(mx.video.UIManager.PLAY_PAUSE_BUTTON);
  1035.       }
  1036.       return this._playPauseButton;
  1037.    }
  1038.    function set playPauseButton(s)
  1039.    {
  1040.       this._playPauseButton = s;
  1041.       if(this._uiMgr != null && this._uiMgr != undefined)
  1042.       {
  1043.          this._uiMgr.setControl(mx.video.UIManager.PLAY_PAUSE_BUTTON,s);
  1044.       }
  1045.    }
  1046.    function get preferredHeight()
  1047.    {
  1048.       if(this._vp[this._activeVP] == undefined)
  1049.       {
  1050.          return 0;
  1051.       }
  1052.       return this._vp[this._activeVP].videoHeight;
  1053.    }
  1054.    function get preferredWidth()
  1055.    {
  1056.       if(this._vp[this._activeVP] == undefined)
  1057.       {
  1058.          return 0;
  1059.       }
  1060.       return this._vp[this._activeVP].videoWidth;
  1061.    }
  1062.    function get progressInterval()
  1063.    {
  1064.       if(this._vp[this._activeVP] == undefined)
  1065.       {
  1066.          return this._progressInterval;
  1067.       }
  1068.       return this._vp[this._activeVP].progressInterval;
  1069.    }
  1070.    function set progressInterval(aTime)
  1071.    {
  1072.       if(this._activeVP == 0 || this._activeVP == undefined)
  1073.       {
  1074.          this._progressInterval = aTime;
  1075.       }
  1076.       this._vp[this._activeVP].progressInterval = aTime;
  1077.    }
  1078.    function get scaleX()
  1079.    {
  1080.       if(this._vp[this._visibleVP] != undefined)
  1081.       {
  1082.          this._scaleX = this._vp[this._visibleVP].width / this._origWidth * 100;
  1083.       }
  1084.       return this._scaleX;
  1085.    }
  1086.    function set scaleX(xs)
  1087.    {
  1088.       this.setScale(xs,this.__get__scaleY());
  1089.    }
  1090.    function get scaleY()
  1091.    {
  1092.       if(this._vp[this._visibleVP] != undefined)
  1093.       {
  1094.          this._scaleY = this._vp[this._visibleVP].height / this._origHeight * 100;
  1095.       }
  1096.       return this._scaleY;
  1097.    }
  1098.    function set scaleY(ys)
  1099.    {
  1100.       this.setScale(this.__get__scaleX(),ys);
  1101.    }
  1102.    function get scrubbing()
  1103.    {
  1104.       var _loc2_ = this.__get__seekBar();
  1105.       if(_loc2_ == undefined || _loc2_.isDragging == undefined)
  1106.       {
  1107.          return false;
  1108.       }
  1109.       return _loc2_.isDragging;
  1110.    }
  1111.    function get seekBar()
  1112.    {
  1113.       if(this._uiMgr != null && this._uiMgr != undefined)
  1114.       {
  1115.          this._seekBar = this._uiMgr.getControl(mx.video.UIManager.SEEK_BAR);
  1116.       }
  1117.       return this._seekBar;
  1118.    }
  1119.    function set seekBar(s)
  1120.    {
  1121.       this._seekBar = s;
  1122.       if(this._uiMgr != null && this._uiMgr != undefined)
  1123.       {
  1124.          this._uiMgr.setControl(mx.video.UIManager.SEEK_BAR,s);
  1125.       }
  1126.    }
  1127.    function get seekBarInterval()
  1128.    {
  1129.       if(this._uiMgr != null && this._uiMgr != undefined)
  1130.       {
  1131.          this._seekBarInterval = this._uiMgr.seekBarInterval;
  1132.       }
  1133.       return this._seekBarInterval;
  1134.    }
  1135.    function set seekBarInterval(s)
  1136.    {
  1137.       this._seekBarInterval = s;
  1138.       if(this._uiMgr != null && this._uiMgr != undefined)
  1139.       {
  1140.          this._uiMgr.__set__seekBarInterval(this._seekBarInterval);
  1141.       }
  1142.    }
  1143.    function get seekBarScrubTolerance()
  1144.    {
  1145.       if(this._uiMgr != null && this._uiMgr != undefined)
  1146.       {
  1147.          this._seekBarScrubTolerance = this._uiMgr.seekBarScrubTolerance;
  1148.       }
  1149.       return this._seekBarScrubTolerance;
  1150.    }
  1151.    function set seekBarScrubTolerance(s)
  1152.    {
  1153.       this._seekBarScrubTolerance = s;
  1154.       if(this._uiMgr != null && this._uiMgr != undefined)
  1155.       {
  1156.          this._uiMgr.__set__seekBarScrubTolerance(this._seekBarScrubTolerance);
  1157.       }
  1158.    }
  1159.    function get seekToPrevOffset()
  1160.    {
  1161.       return this._seekToPrevOffset;
  1162.    }
  1163.    function set seekToPrevOffset(s)
  1164.    {
  1165.       this._seekToPrevOffset = s;
  1166.    }
  1167.    function get skin()
  1168.    {
  1169.       if(this._uiMgr != null && this._uiMgr != undefined)
  1170.       {
  1171.          this._skin = this._uiMgr.skin;
  1172.       }
  1173.       return this._skin;
  1174.    }
  1175.    function set skin(s)
  1176.    {
  1177.       this._skin = s;
  1178.       if(this._uiMgr != null && this._uiMgr != undefined)
  1179.       {
  1180.          this._uiMgr.__set__skin(s);
  1181.       }
  1182.    }
  1183.    function get skinAutoHide()
  1184.    {
  1185.       if(this._uiMgr != null && this._uiMgr != undefined)
  1186.       {
  1187.          this._skinAutoHide = this._uiMgr.skinAutoHide;
  1188.       }
  1189.       return this._skinAutoHide;
  1190.    }
  1191.    function set skinAutoHide(b)
  1192.    {
  1193.       if(_global.isLivePreview)
  1194.       {
  1195.          return undefined;
  1196.       }
  1197.       this._skinAutoHide = b;
  1198.       if(this._uiMgr != null && this._uiMgr != undefined)
  1199.       {
  1200.          this._uiMgr.__set__skinAutoHide(b);
  1201.       }
  1202.    }
  1203.    function get transform()
  1204.    {
  1205.       return this._transform;
  1206.    }
  1207.    function set transform(s)
  1208.    {
  1209.       this._transform = s;
  1210.       if(this._vp[this._activeVP] != undefined)
  1211.       {
  1212.          this._vp[this._activeVP].transform = this._transform;
  1213.       }
  1214.    }
  1215.    function get state()
  1216.    {
  1217.       if(_global.isLivePreview)
  1218.       {
  1219.          return mx.video.FLVPlayback.STOPPED;
  1220.       }
  1221.       if(this._vp[this._activeVP] == undefined)
  1222.       {
  1223.          return mx.video.FLVPlayback.DISCONNECTED;
  1224.       }
  1225.       if(this._activeVP == this._visibleVP && this.__get__scrubbing())
  1226.       {
  1227.          return mx.video.FLVPlayback.SEEKING;
  1228.       }
  1229.       var _loc3_ = this._vp[this._activeVP].state;
  1230.       if(_loc3_ == mx.video.VideoPlayer.RESIZING)
  1231.       {
  1232.          return mx.video.FLVPlayback.LOADING;
  1233.       }
  1234.       if(this._vpState[this._activeVP].prevState == mx.video.FLVPlayback.LOADING && this._vpState[this._activeVP].autoPlay && _loc3_ == mx.video.FLVPlayback.STOPPED)
  1235.       {
  1236.          return mx.video.FLVPlayback.LOADING;
  1237.       }
  1238.       return _loc3_;
  1239.    }
  1240.    function get stateResponsive()
  1241.    {
  1242.       if(this._vp[this._activeVP] == undefined)
  1243.       {
  1244.          return false;
  1245.       }
  1246.       return this._vp[this._activeVP].stateResponsive;
  1247.    }
  1248.    function get stopButton()
  1249.    {
  1250.       if(this._uiMgr != null && this._uiMgr != undefined)
  1251.       {
  1252.          this._stopButton = this._uiMgr.getControl(mx.video.UIManager.STOP_BUTTON);
  1253.       }
  1254.       return this._stopButton;
  1255.    }
  1256.    function set stopButton(s)
  1257.    {
  1258.       this._stopButton = s;
  1259.       if(this._uiMgr != null && this._uiMgr != undefined)
  1260.       {
  1261.          this._uiMgr.setControl(mx.video.UIManager.STOP_BUTTON,s);
  1262.       }
  1263.    }
  1264.    function get stopped()
  1265.    {
  1266.       if(this._vp[this._activeVP] == undefined)
  1267.       {
  1268.          return false;
  1269.       }
  1270.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.STOPPED;
  1271.    }
  1272.    function get totalTime()
  1273.    {
  1274.       if(_global.isLivePreview)
  1275.       {
  1276.          return 1;
  1277.       }
  1278.       if(this._vp[this._activeVP] == undefined)
  1279.       {
  1280.          return this._totalTime;
  1281.       }
  1282.       if(this._vpState[this._activeVP].totalTimeSet)
  1283.       {
  1284.          return this._vpState[this._activeVP].totalTime;
  1285.       }
  1286.       return this._vp[this._activeVP].totalTime;
  1287.    }
  1288.    function set totalTime(aTime)
  1289.    {
  1290.       if(this._activeVP == 0 || this._activeVP == undefined)
  1291.       {
  1292.          this._totalTime = aTime;
  1293.       }
  1294.       this._vpState[this._activeVP].totalTime = aTime;
  1295.       this._vpState[this._activeVP].totalTimeSet = true;
  1296.    }
  1297.    function get version_1_0_1()
  1298.    {
  1299.       return "";
  1300.    }
  1301.    function set version_1_0_1(v)
  1302.    {
  1303.    }
  1304.    function get visible()
  1305.    {
  1306.       return this._visible;
  1307.    }
  1308.    function set visible(v)
  1309.    {
  1310.       this._visible = v;
  1311.    }
  1312.    function get visibleVideoPlayerIndex()
  1313.    {
  1314.       return this._visibleVP;
  1315.    }
  1316.    function set visibleVideoPlayerIndex(i)
  1317.    {
  1318.       if(this._visibleVP == i)
  1319.       {
  1320.          return undefined;
  1321.       }
  1322.       var _loc2_ = this._visibleVP;
  1323.       if(this._vp[i] == undefined)
  1324.       {
  1325.          this.createVideoPlayer(i);
  1326.       }
  1327.       var _loc5_ = this._vp[i].height != this._vp[this._visibleVP].height || this._vp[i].width != this._vp[this._visibleVP].width;
  1328.       this._vp[this._visibleVP].visible = false;
  1329.       this._vp[this._visibleVP].volume = 0;
  1330.       this._visibleVP = i;
  1331.       if(this._firstStreamShown)
  1332.       {
  1333.          this._uiMgr.setupSkinAutoHide(_loc2_);
  1334.          this._vp[this._visibleVP].visible = true;
  1335.          if(!this.__get__scrubbing())
  1336.          {
  1337.             this._vp[this._visibleVP].volume = this._volume;
  1338.          }
  1339.       }
  1340.       else if(this._vp[this._visibleVP].stateResponsive && this._vp[this._visibleVP].state != mx.video.FLVPlayback.DISCONNECTED && this._uiMgr.__get__skinReady())
  1341.       {
  1342.          this._uiMgr.__set__visible(true);
  1343.          this._uiMgr.setupSkinAutoHide(_loc2_);
  1344.          this._firstStreamReady = true;
  1345.          this.showFirstStream();
  1346.       }
  1347.       if(this._vp[_loc2_].height != this._vp[this._visibleVP].height || this._vp[_loc2_].width != this._vp[this._visibleVP].width)
  1348.       {
  1349.          this.dispatchEvent({type:"resize",x:this.__get__x(),y:this.__get__y(),width:this.__get__width(),height:this.__get__height(),auto:false,vp:this._visibleVP});
  1350.       }
  1351.       this._uiMgr.handleEvent({type:"stateChange",state:this._vp[this._visibleVP].state,vp:this._visibleVP});
  1352.       this._uiMgr.handleEvent({type:"playheadUpdate",playheadTime:this._vp[this._visibleVP].playheadTime,vp:this._visibleVP});
  1353.       if(this._vp[this._visibleVP].isRTMP)
  1354.       {
  1355.          this._uiMgr.handleEvent({type:"ready",vp:this._visibleVP});
  1356.       }
  1357.       else
  1358.       {
  1359.          this._uiMgr.handleEvent({type:"progress",bytesLoaded:this._vp[this._visibleVP].bytesLoaded,bytesTotal:this._vp[this._visibleVP].bytesTotal,vp:this._visibleVP});
  1360.       }
  1361.    }
  1362.    function get volume()
  1363.    {
  1364.       return this._volume;
  1365.    }
  1366.    function set volume(aVol)
  1367.    {
  1368.       if(this._volume == aVol)
  1369.       {
  1370.          return undefined;
  1371.       }
  1372.       this._volume = aVol;
  1373.       if(!this.__get__scrubbing())
  1374.       {
  1375.          this._vp[this._visibleVP].volume = this._volume;
  1376.       }
  1377.       this.dispatchEvent({type:"volumeUpdate",volume:aVol});
  1378.    }
  1379.    function get volumeBar()
  1380.    {
  1381.       if(this._uiMgr != null && this._uiMgr != undefined)
  1382.       {
  1383.          this._volumeBar = this._uiMgr.getControl(mx.video.UIManager.VOLUME_BAR);
  1384.       }
  1385.       return this._volumeBar;
  1386.    }
  1387.    function set volumeBar(s)
  1388.    {
  1389.       this._volumeBar = s;
  1390.       if(this._uiMgr != null && this._uiMgr != undefined)
  1391.       {
  1392.          this._uiMgr.setControl(mx.video.UIManager.VOLUME_BAR,s);
  1393.       }
  1394.    }
  1395.    function get volumeBarInterval()
  1396.    {
  1397.       if(this._uiMgr != null && this._uiMgr != undefined)
  1398.       {
  1399.          this._volumeBarInterval = this._uiMgr.volumeBarInterval;
  1400.       }
  1401.       return this._volumeBarInterval;
  1402.    }
  1403.    function set volumeBarInterval(s)
  1404.    {
  1405.       this._volumeBarInterval = s;
  1406.       if(this._uiMgr != null && this._uiMgr != undefined)
  1407.       {
  1408.          this._uiMgr.__set__volumeBarInterval(this._volumeBarInterval);
  1409.       }
  1410.    }
  1411.    function get volumeBarScrubTolerance()
  1412.    {
  1413.       if(this._uiMgr != null && this._uiMgr != undefined)
  1414.       {
  1415.          this._volumeBarScrubTolerance = this._uiMgr.volumeBarScrubTolerance;
  1416.       }
  1417.       return this._volumeBarScrubTolerance;
  1418.    }
  1419.    function set volumeBarScrubTolerance(s)
  1420.    {
  1421.       this._volumeBarScrubTolerance = s;
  1422.       if(this._uiMgr != null && this._uiMgr != undefined)
  1423.       {
  1424.          this._uiMgr.__set__volumeBarScrubTolerance(this._volumeBarScrubTolerance);
  1425.       }
  1426.    }
  1427.    function get width()
  1428.    {
  1429.       if(_global.isLivePreview)
  1430.       {
  1431.          return this.__width;
  1432.       }
  1433.       if(this._vp[this._visibleVP] != undefined)
  1434.       {
  1435.          this.__width = this._vp[this._visibleVP].width;
  1436.       }
  1437.       return this.__width;
  1438.    }
  1439.    function set width(w)
  1440.    {
  1441.       this.setSize(w,this.__get__height());
  1442.    }
  1443.    function get x()
  1444.    {
  1445.       return this._x;
  1446.    }
  1447.    function set x(xpos)
  1448.    {
  1449.       this._x = xpos;
  1450.    }
  1451.    function get y()
  1452.    {
  1453.       return this._y;
  1454.    }
  1455.    function set y(ypos)
  1456.    {
  1457.       this._y = ypos;
  1458.    }
  1459.    function createVideoPlayer(index)
  1460.    {
  1461.       if(_global.isLivePreview)
  1462.       {
  1463.          return undefined;
  1464.       }
  1465.       var _loc4_ = this.__get__width();
  1466.       var _loc5_ = this.__get__height();
  1467.       this._vp[index] = mx.video.VideoPlayer(this.attachMovie("VideoPlayer",String(index),mx.video.FLVPlayback.VP_DEPTH_OFFSET + index));
  1468.       this._vp[index].setSize(_loc4_,_loc5_);
  1469.       this._topVP = index;
  1470.       this._vp[index].autoRewind = this._autoRewind;
  1471.       this._vp[index].autoSize = this._autoSize;
  1472.       this._vp[index].bufferTime = this._bufferTime;
  1473.       this._vp[index].idleTimeout = this._idleTimeout;
  1474.       this._vp[index].maintainAspectRatio = this._aspectRatio;
  1475.       this._vp[index].playheadUpdateInterval = this._playheadUpdateInterval;
  1476.       this._vp[index].progressInterval = this._progressInterval;
  1477.       this._vp[index].transform = this._transform;
  1478.       this._vp[index].volume = this._volume;
  1479.       if(index == 0)
  1480.       {
  1481.          this._vpState[index] = {id:index,isLive:this._isLive,isLiveSet:true,totalTime:this._totalTime,totalTimeSet:true,autoPlay:this._autoPlay};
  1482.          if(this._contentPath != null && this._contentPath != undefined && this._contentPath != "")
  1483.          {
  1484.             this._vp[index].onEnterFrame = mx.utils.Delegate.create(this,this.doContentPathConnect);
  1485.          }
  1486.       }
  1487.       else
  1488.       {
  1489.          this._vpState[index] = {id:index,isLive:false,isLiveSet:true,totalTime:0,totalTimeSet:true,autoPlay:false};
  1490.       }
  1491.       this._vp[index].addEventListener("resize",this);
  1492.       this._vp[index].addEventListener("close",this);
  1493.       this._vp[index].addEventListener("complete",this);
  1494.       this._vp[index].addEventListener("cuePoint",this);
  1495.       this._vp[index].addEventListener("playheadUpdate",this);
  1496.       this._vp[index].addEventListener("progress",this);
  1497.       this._vp[index].addEventListener("metadataReceived",this);
  1498.       this._vp[index].addEventListener("stateChange",this);
  1499.       this._vp[index].addEventListener("ready",this);
  1500.       this._vp[index].addEventListener("rewind",this);
  1501.       this._cpMgr[index] = new mx.video.CuePointManager(this,index);
  1502.       this._cpMgr[index].playheadUpdateInterval = this._playheadUpdateInterval;
  1503.    }
  1504.    function createUIManager()
  1505.    {
  1506.       this._uiMgr = new mx.video.UIManager(this);
  1507.       this._uiMgr.__set__visible(false);
  1508.       if(this._backButton != undefined && this._backButton != null)
  1509.       {
  1510.          this._uiMgr.setControl(mx.video.UIManager.BACK_BUTTON,this._backButton);
  1511.       }
  1512.       if(this._bufferingBar != undefined && this._bufferingBar != null)
  1513.       {
  1514.          this._uiMgr.setControl(mx.video.UIManager.BUFFERING_BAR,this._bufferingBar);
  1515.       }
  1516.       this._uiMgr.__set__bufferingBarHidesAndDisablesOthers(this._bufferingBarHides);
  1517.       if(this._forwardButton != undefined && this._forwardButton != null)
  1518.       {
  1519.          this._uiMgr.setControl(mx.video.UIManager.FORWARD_BUTTON,this._forwardButton);
  1520.       }
  1521.       if(this._pauseButton != undefined && this._pauseButton != null)
  1522.       {
  1523.          this._uiMgr.setControl(mx.video.UIManager.PAUSE_BUTTON,this._pauseButton);
  1524.       }
  1525.       if(this._playButton != undefined && this._playButton != null)
  1526.       {
  1527.          this._uiMgr.setControl(mx.video.UIManager.PLAY_BUTTON,this._playButton);
  1528.       }
  1529.       if(this._playPauseButton != undefined && this._playPauseButton != null)
  1530.       {
  1531.          this._uiMgr.setControl(mx.video.UIManager.PLAY_PAUSE_BUTTON,this._playPauseButton);
  1532.       }
  1533.       if(this._stopButton != undefined && this._stopButton != null)
  1534.       {
  1535.          this._uiMgr.setControl(mx.video.UIManager.STOP_BUTTON,this._stopButton);
  1536.       }
  1537.       if(this._seekBar != undefined && this._seekBar != null)
  1538.       {
  1539.          this._uiMgr.setControl(mx.video.UIManager.SEEK_BAR,this._seekBar);
  1540.       }
  1541.       if(this._seekBarInterval != undefined && this._seekBarInterval != null)
  1542.       {
  1543.          this._uiMgr.__set__seekBarInterval(this._seekBarInterval);
  1544.       }
  1545.       if(this._seekBarScrubTolerance != undefined && this._seekBarScrubTolerance != null)
  1546.       {
  1547.          this._uiMgr.__set__seekBarScrubTolerance(this._seekBarScrubTolerance);
  1548.       }
  1549.       if(this._skin != undefined && this._skin != null)
  1550.       {
  1551.          this._uiMgr.__set__skin(this._skin);
  1552.       }
  1553.       if(this._skinAutoHide != undefined && this._skinAutoHide != null)
  1554.       {
  1555.          this._uiMgr.__set__skinAutoHide(this._skinAutoHide);
  1556.       }
  1557.       if(this._muteButton != undefined && this._muteButton != null)
  1558.       {
  1559.          this._uiMgr.setControl(mx.video.UIManager.MUTE_BUTTON,this._muteButton);
  1560.       }
  1561.       if(this._volumeBar != undefined && this._volumeBar != null)
  1562.       {
  1563.          this._uiMgr.setControl(mx.video.UIManager.VOLUME_BAR,this._volumeBar);
  1564.       }
  1565.       if(this._volumeBarInterval != undefined && this._volumeBarInterval != null)
  1566.       {
  1567.          this._uiMgr.__set__volumeBarInterval(this._volumeBarInterval);
  1568.       }
  1569.       if(this._volumeBarScrubTolerance != undefined && this._volumeBarScrubTolerance != null)
  1570.       {
  1571.          this._uiMgr.__set__volumeBarScrubTolerance(this._volumeBarScrubTolerance);
  1572.       }
  1573.    }
  1574.    function createLivePreviewMovieClip()
  1575.    {
  1576.       this.preview_mc = this.createEmptyMovieClip("preview_mc",10);
  1577.       this.preview_mc.createEmptyMovieClip("box_mc",10);
  1578.       this.preview_mc.box_mc.beginFill(0);
  1579.       this.preview_mc.box_mc.moveTo(0,0);
  1580.       this.preview_mc.box_mc.lineTo(0,100);
  1581.       this.preview_mc.box_mc.lineTo(100,100);
  1582.       this.preview_mc.box_mc.lineTo(100,0);
  1583.       this.preview_mc.box_mc.lineTo(0,0);
  1584.       this.preview_mc.box_mc.endFill();
  1585.       this.preview_mc.attachMovie("Icon","icon_mc",20);
  1586.    }
  1587.    function doContentPathConnect()
  1588.    {
  1589.       delete this._vp[0].onEnterFrame;
  1590.       this._vp[0].onEnterFrame = undefined;
  1591.       if(_global.isLivePreview)
  1592.       {
  1593.          return undefined;
  1594.       }
  1595.       if(this._vpState[0].autoPlay && this._firstStreamShown)
  1596.       {
  1597.          this._vp[0].play(this._contentPath,this._isLive,this._totalTime);
  1598.       }
  1599.       else
  1600.       {
  1601.          this._vp[0].load(this._contentPath,this._isLive,this._totalTime);
  1602.       }
  1603.       this._vpState[0].isLiveSet = false;
  1604.       this._vpState[0].totalTimeSet = false;
  1605.    }
  1606.    function showFirstStream()
  1607.    {
  1608.       this._firstStreamShown = true;
  1609.       this._vp[this._visibleVP].visible = true;
  1610.       if(!this.__get__scrubbing())
  1611.       {
  1612.          this._vp[this._visibleVP].volume = this._volume;
  1613.       }
  1614.       var _loc2_ = 0;
  1615.       while(_loc2_ < this._vp.length)
  1616.       {
  1617.          if(this._vp[_loc2_] != undefined && this._vp[_loc2_].state == mx.video.FLVPlayback.STOPPED && this._vpState[_loc2_].autoPlay)
  1618.          {
  1619.             this._vp[_loc2_].play();
  1620.          }
  1621.          _loc2_ = _loc2_ + 1;
  1622.       }
  1623.    }
  1624.    function _scrubStart()
  1625.    {
  1626.       var _loc2_ = this.__get__playheadTime();
  1627.       this._vp[this._visibleVP].volume = 0;
  1628.       this.dispatchEvent({type:"stateChange",state:mx.video.FLVPlayback.SEEKING,playheadTime:_loc2_,vp:this._visibleVP});
  1629.       this.dispatchEvent({type:"scrubStart",state:mx.video.FLVPlayback.SEEKING,playheadTime:_loc2_});
  1630.    }
  1631.    function _scrubFinish()
  1632.    {
  1633.       var _loc3_ = this.__get__playheadTime();
  1634.       var _loc2_ = this.__get__state();
  1635.       this._vp[this._visibleVP].volume = this._volume;
  1636.       if(_loc2_ != mx.video.FLVPlayback.SEEKING)
  1637.       {
  1638.          this.dispatchEvent({type:"stateChange",state:_loc2_,playheadTime:_loc3_,vp:this._visibleVP});
  1639.       }
  1640.       this.dispatchEvent({type:"scrubFinish",state:_loc2_,playheadTime:_loc3_});
  1641.    }
  1642.    function skinError(message)
  1643.    {
  1644.       if(this._firstStreamReady && !this._firstStreamShown)
  1645.       {
  1646.          this.showFirstStream();
  1647.       }
  1648.       this.dispatchEvent({type:"skinError",message:message});
  1649.    }
  1650.    function skinLoaded()
  1651.    {
  1652.       if(this._firstStreamReady)
  1653.       {
  1654.          this._uiMgr.__set__visible(true);
  1655.          if(!this._firstStreamShown)
  1656.          {
  1657.             this.showFirstStream();
  1658.          }
  1659.       }
  1660.       else if(this._contentPath == undefined || this._contentPath == null || this._contentPath == "")
  1661.       {
  1662.          this._uiMgr.__set__visible(true);
  1663.       }
  1664.       this.dispatchEvent({type:"skinLoaded"});
  1665.    }
  1666. }
  1667.